//
//  UITabBar+Extension.swift
//  demo
//
//  Created by ZWJY on 2021/8/20.
//

import Foundation
import UIKit

// MARK: - 修改iPad下 tabbar 左右布局问题
public extension UITabBar {
     override var traitCollection: UITraitCollection{
         let old = super.traitCollection
        if UIDevice.current.userInterfaceIdiom == .pad {
            let tmp = UITraitCollection(horizontalSizeClass: .compact)
            let new = UITraitCollection(traitsFrom: [old, tmp])
            return new
        }
        return old
    }
}
